package com.teamin.service;

import com.teamin.entity.CircleUserEntity;
import com.teamin.entity.MessageEntity;

public interface WebsocketService {

	void sendTask(Long userId,Long circleId, Long taskId, TaskPropertise propertise, Control control, Object value,String userFlag);

	/**
	 * 发送给用户的能知消息
	 * @param toUser
	 * @param userId
	 * @param propertise
	 * @param messageId
	 */
	void sendToUserNotifi(Long toUser, Long userId,Long circleId, NotifiPropertise propertise, MessageEntity messageId,String userFlag);

	void sendToUserNotifi(Long toUser, Long userId, Long circleId, NotifiPropertise propertise, Object obj,String userFlag);

	void sendToUserNotifi(Long toUser, CircleUserEntity circleUserEntity, Long circleId, NotifiPropertise propertise, MessageEntity messageId,String userFlag);

	void sendToUserNotifi(Long toUser, CircleUserEntity circleUserEntity, Long circleId, NotifiPropertise propertise, Object obj,String userFlag);

	void sendToCircleUserNotifi(Long toUser, CircleUserEntity circleUserEntity, Long circleId, NotifiPropertise propertise, MessageEntity messageId,String userFlag);

	void sendToCircleUserNotifi(Long toUser, Long userId, Long circleId, NotifiPropertise propertise, Object value,String userFlag);

	/**
	 * 圈子的基本信息
	 */
	public enum CirclePropertise{

		BASE(1, "base"), //圈子的基本信息
		USER (2, "user"), //圈子的成员属性
		TASK (3, "task"), //圈子的任务信息
		CIRCLE_LABEL (4, "label"), //圈子的标签
		TASK_LABEL (300, "task_label"), //圈子的任务信息
		TASK_COMMENTS (400, "task_comment"),//任务评论信息
		TASK_USER_READ_POSITION (501, "task_user_read_position"), //任务评论的位置
		NET_DISK_FILE_MODIFY(201, "net_disk_file_modify"),
		NET_DISK_FILE_MOVE(202, "net_disk_file_move");

		private final short type;

		private final String desc;
		public String value() {
			return this.desc;
		}

		CirclePropertise(int value, String desc) {
			this.type = (short) value;
			this.desc = desc;
		}
	}

	/**
	 * 任务的基本信息
	 */
	public enum TaskPropertise{

		BASE(1, "base"), //任务的基本信息
		ATTENTION (2, "attention"), //任务的关注者
		COMMENT(3, "comment"), //任务的评论
		LABEL(4, "label"); //任务的标签

		private final short type;

		private final String desc;
		public String value() {
			return this.desc;
		}

		TaskPropertise(int value, String desc) {
			this.type = (short) value;
			this.desc = desc;
		}
	}

	/**
	 * 消息基本信息
	 */
	public enum NotifiPropertise{

		UNASSIGNER(1, "unassigner"), //取消任务为执行者
		ASSIGNERED (2, "assignered"), //被设为任务的执行者
		AT(3, "at"), //AT 功能,
		REMOVED_USER_CIRCLE (100, "remove_user_circle"), //从圈子中删除用户
		TASK_DELETE (1000, "task_delete"), //删除任务
		TASK_ASSIGNERED (10101, "task_assignered"), //被设为任务的执行者
		MESSAGE_CHANGE (20101, "message_change"), //消息被改变
		TASK_REMIND(10301, "task_remind"), //任务提醒
		USER_CIRCLE_JUSTLOOK_TASK_POSITION(10401, "circle_user_ustlook_task_position"); //用户更新最后查看最近添加的任务的位置

		private final short type;

		private final String desc;
		public String value() {
			return this.desc;
		}

		NotifiPropertise(int value, String desc) {
			this.type = (short) value;
			this.desc = desc;
		}
	}

	/**
	 * 圈子的基本信息
	 */
	public enum Control{

		ADD(1, "add"), //添加
		DELETE (2, "delete"), //删除
		MODIFY(3, "modify"), //修改
		MOVE(4, "move"); //移动

		private final short type;

		private final String desc;
		public String value() {
			return this.desc;
		}
		Control(int value, String desc) {
			this.type = (short) value;
			this.desc = desc;
		}
	}

	//圈子信息同步
	void sendCircle(CircleUserEntity circleUserEntity, Long circleId, CirclePropertise propertise, Control control, Object value,String userFlag);

	// 发送圈子的订阅消息
	public void sendCircle(Long userId,Long circleId,CirclePropertise propertise,Control control,Object value,String userFlag) ;

}
